﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;



namespace SandcastleUtils.Drop
{
    [ContentType("code")]
    [Export(typeof(IKeyProcessorProvider))]
    [Name("Launch Editor KeyProcessor")]
    [Order(Before = "Regex Key Processor")]
	[TextViewRole(PredefinedTextViewRoles.Document)]
	internal sealed class LaunchEditorKeyProcessorProvider : IKeyProcessorProvider
    {
        //[Import(typeof(RegexEditorService))]
        //private RegexEditorService RegexEditorService { get; set; }

        [Import]
        internal SVsServiceProvider ServiceProvider = null; 

        #region IKeyProcessorProvider Members

        public KeyProcessor GetAssociatedProcessor(IWpfTextView wpfTextView)
        {
            try
            {
                return new LaunchEditorKeyProcessor(wpfTextView, ServiceProvider);
            }
            catch(Exception ex)
            {
               return new LaunchEditorKeyProcessor(wpfTextView, ServiceProvider);
            }
        }

        #endregion
    }
}